package com.cqie.secondhandtransaction.controller;

import com.cqie.secondhandtransaction.DTO.DataList;
import com.cqie.secondhandtransaction.entity.ProductType;
import com.cqie.secondhandtransaction.model.Result;
import com.cqie.secondhandtransaction.service.ProductTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author gdy
 * @since 2025-02-10
 */
@RestController
@RequestMapping("/product/type")
@Api(value = "商品类别", tags = {"商品类别"})
public class ProductTypeController extends BaseController {

    @Autowired
    private ProductTypeService productTypeService;

    @GetMapping("/list")
    @ApiOperation(value = "获取商品类别列表", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiResponse(code = 200, message = "ok", response = Result.class)
    public Result<DataList<ProductType>> getProductTypeList() {
        return response(productTypeService.getProductTypeList());
    }

}
